import json
import urllib
import urllib2
from pprint import pprint

query = "Rafiq Abdus Sabir"

url = ('https://ajax.googleapis.com/ajax/services/search/news'
       '?v=1.0&q=%s&key=ABQIAAAA4gwns0zx8U67ik_3pJ5qixTTZWgstBt-XgH2JzknQYqzg9VZShStiyurKVRPnNwgdchflK35CN8SHw&userip=10.0.0.1' % \
           (urllib.quote(query)))

request = urllib2.Request(
    url, None, {'Referer': 'http://www.not-a-domain-name.com'})
response = urllib2.urlopen(request)

# Process the JSON string.
results = json.load(response)
# now have some fun with the results...

pprint(results)
